#文档的打开
p = open('001.txt','r',encoding= 'utf-8')
print(p)

with open('C:\Users\Administrator\Desktop\001.txt','r',encoding='utf-8') as file:
    text =(file.read())
    print(text)
#写文件
bab='hello,hello'
wi = open('022','w',encoding='utf-8')
wi.write(bab)
wi.close()
#打开文件增加
with open('022','w',encoding='utf-8')as sss:
    sss.write(bab)
#下载库
import pandas as pd
# df=pd.read_excel(r'C:\Users\Administrator\Desktop/111.xlsx')
# print(df)

a1={'name':'zhangsan','xiamg':'nan'}
a2={'name':'lisi','xiang':'name'}
a3={'name':'liwu','xiang':'name'}
l1=[a1,a2,a3]
print(l1)
#转换为DataFrame
df1=pd.DataFrame(l1)
print(df1 )
df1.to_excel('2222.xlsx',index=False)



from docx import Document
doc=Document('2023年国务院政府工作报告.docx')
print(doc)
p=doc.paragraphs
print(p)
for i in p:
    print(i.text)